<?php
require_once( dirname( __FILE__ ) . '/../../config.SRDO.php' );
?>
<html>
<head><title>SRDO Schema</title></head>
<style type="text/css">
	BODY, TABLE, TD {
		font-family: sans-serif;
		font-size: 10px;
	}
	TD {
		background-color: white;
	}
</style>
<body>
<table border="0" cellpadding="4" cellspacing="1" style="background-color: #656565; width: 850px;">
<?
foreach ( SRDO::getTableNames() AS $t) {
	$ts = SRDO_Table::compareSchema($t);
	if (is_array($ts)) {
		if (count($ts) == 0) continue;
		printf('<tr><td colspan="4" style="background-color: #CCCCCC;">%s</td></tr>', $t);
		foreach ($ts AS $k => $v) {
			printf('<tr><td valign="top"><input type="checkbox"></td><td valign="top">%s</td><td valign="top">%s</td>' . 
					'<td valign="top"><input type="text" style="width: 100%%; font-size: 10px; font-family: sans-serif; border: 0px;" value="%s"><br><i>%s<br>%s</i></td>',
					$v['action'], $k, $v['sql'], $v['sql_local'], $v['db_sql']);
		}
	} else {
		$oT = new SRDO_Table($t);
		printf('<tr><td colspan="4">Table %s does not exist!<br><pre>%s</pre>',
				$t,
				$oT->getCreateTable());
	}
}
?>
</table>
</body>
</html>
<?
exit;

header('Content-type: text/plain');
echo date('r') . "\n";

list($ss, $su) = explode(' ', $bts);
$start = (float)$su + (float)$ss;
list($es, $eu) = explode(' ', $ets);
$end = (float)$eu + (float)$es;

echo "Definition generation time: " . ($end - $start) . "\n";

/*
$oT = &SRDO::factory('invoice');

//$oT->find(true);
print_r(SRDO_Table::compareSchema('invoice'));
print_r($_SMSG);

$oT = new SRDO_Table('invoice');
print_r($oT->getCreateTable());
*/

/*
$oDO = &$oT->getDataObject();

echo "Invoice ID: " . $oT->id_invoice . "\n";
echo "Invoice Type: " . $oT->type->type . "\n";
echo $oDO->total->label . ": <input type='invoice_total' value='" . $oDO->total->value . "'>\n";
*/

echo "\n\n\n";


//print_r($oT->getDataObject());
//print_r($oT);